{extend name="common/public" /}
{block name="content" /}
<div class="am-u-sm-12 am-u-md-12 am-u-lg-12" >
    <div class="widget am-cf" style="height: 500px;">
        <div class="widget-head am-cf">

            <div class="widget-title am-fl"> 缓存清理</div>
            <div class="widget-function am-fr">
                <a href="javascript:;" class="am-icon-cog"></a>
            </div>
        </div>
        <div class="widget-body am-fr">
            <button type="button" onclick="add('{:url("")}','form')" class="am-btn  am-btn-lg am-btn-success">
                清空缓存
            </button>
        </div>
    </div>
</div>
<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
    <div class="am-modal-dialog">
        <div class="am-modal-bd">
        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn">确定</span>
        </div>
    </div>
</div>
<script type="text/javascript">
    var is_ajax = 1;
    function add(url) {
        var index =  layer.confirm('确定清空缓存？',function () {
            if(is_ajax ==0) return;
            is_ajax =0;
            $.post('',function (res) {
                is_ajax =1;
                if(res.code!=0){
                    layer.alert(res.msg,{icon:5})
                }else{
                    layer.alert('操作成功!',{icon:6,success:function () {
                        layer.close(index)
                    }})
                }
            },'json')
        })
    }

</script>
{/block}
{extend}

